<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
	<style>
.container {
  text-align: center;
}

.box {
  display: inline-block;
  width: 30%;
  
  background-color: white;
  margin: 10px;
}
</style>
	<style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }
    </style>
    <link rel="stylesheet" href="/static/style.css">

    <title>yolov5 object detection</title>
  </head>
  <body >
  <div class="container">
   <div class="box">
    <form class="form-signin" method=post enctype=multipart/form-data name="form1">
        <img class="mb-4" src="/static/pytorch.png" alt="" width="72">
        <h1 class="h3 mb-3 font-weight-normal">Upload any image or video</h1>
     <input type="file" name="file" class="form-control-file" id="inputfile" >

        <br/>
		    
        <button class="btn btn-lg btn-primary btn-block" type="submit">Upload</button>
  <p class="mt-5 mb-3 text-muted">Built using Pytorch & Flask</p>
    </form>
</div>
   <br>  
		

		 
	
    <script src="//code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
    <script src="//stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>


<!-- detected video display using opencv-->
<img id="my-video-image" src="{{ url_for('video_feed') }}" style="height:640; width:640px" />


<!-- detected image display -->
<img id="my-image" style="display: none;" src="{{ url_for('display', filename=image_path) }}" style="height:640; width:640px"/> 

<script>
document.getElementById("my-image").onload = function() {
  this.style.display = "block";
};
</script>





 <div class="box">
<!-- script for opening a webcam and performing detections -->
<button id="start-webcam" onclick="startWebcam()" class="btn btn-lg btn-primary btn-block">Start Webcam</button>
<script>
function startWebcam() {
  window.location.href = "/webcam_feed";
}
</script>
<!-- webcam ends here -->

 </div>
  <div class="box">

<!-- script for opening a rtsp and performing detections -->
<button id="start-rtsp" onclick="startrtsp()" class="btn btn-lg btn-primary btn-block">Start RTSP Stream</button>
<script>
function startrtsp() {
  window.location.href = "/rtsp_feed";
}
</script>
<!-- rtsp ends here -->
 </div>
 </div>
  </body>
</html>
